package com.kitten.comment.domain.mapper;

import com.kitten.comment.domain.dataobject.CommentLikeDO;
import com.kitten.comment.model.dto.LikeUnlikeCommentMqDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommentLikeDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CommentLikeDO record);

    int insertSelective(CommentLikeDO record);

    CommentLikeDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CommentLikeDO record);

    int updateByPrimaryKey(CommentLikeDO record);

    // 查询用户对评论点赞的记录
    int selectCountByUserIdAndCommentId(@Param("userId") Long userId,@Param("commentId") Long commentId);
    // 查询用户点赞的所有评论
    List<CommentLikeDO> selectByUserId(@Param("userId") Long userId);

    // 批量插入
    int batchInsert(@Param("likes") List<LikeUnlikeCommentMqDTO> likes);
    // 批量删除
    int batchDelete(@Param("unlikes") List<LikeUnlikeCommentMqDTO> unlikes);

}